package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_dynamic;

//DAO
public interface U_dynamicMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_DYNAMIC  WHERE ID = #{id}")
	public ApiU_dynamic findU_dynamicById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM U_dynamic")
	public List<ApiU_dynamic> findU_dynamics();

	// //根据条件查看数据集
	// public List<Map<String, Object>> findU_dynamicsByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO U_DYNAMIC (USER_ID, ADD_TIME, CONTEXT, IS_DELETE, TYPE, IS_AGAINST, EXT1, EXT2, EXT3, EXT4, EXT5, CONTENT_TYPE, STATUS, SHARE_COUNT, IS_OPEN, LONGITUDE, LATITUDE, ADDRESS) VALUES (#{user_id}, #{add_time}, #{context}, #{is_delete}, #{type}, #{is_against}, #{ext1}, #{ext2}, #{ext3}, #{ext4}, #{ext5}, #{content_type}, #{status}, #{share_count}, #{is_open}, #{longitude}, #{latitude}, #{address})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertU_dynamic(ApiU_dynamic u_dynamic);

	// 修改
	@Update("UPDATE U_DYNAMIC SET USER_ID = #{user_id}, ADD_TIME = #{add_time}, CONTEXT = #{context}, IS_DELETE = #{is_delete}, TYPE = #{type}, IS_AGAINST = #{is_against}, EXT1 = #{ext1}, EXT2 = #{ext2}, EXT3 = #{ext3}, EXT4 = #{ext4}, EXT5 = #{ext5}, CONTENT_TYPE = #{content_type}, STATUS = #{status}, SHARE_COUNT = #{share_count}, IS_OPEN = #{is_open}, LONGITUDE = #{longitude}, LATITUDE = #{latitude}, ADDRESS = #{address} WHERE ID = #{id}")
	public int updateU_dynamic(ApiU_dynamic u_dynamic);

	// 删除
	@Delete("DELETE FROM U_DYNAMIC  WHERE ID = #{id}")
	public int deleteU_dynamic(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
